#include <iostream>
#include <vector>
using namespace std;

void multiply(vector<int>& num, int x) {
    int carry = 0;
    for (int& digit : num) {
        int product = digit * x + carry;
        digit = product % 10;
        carry = product / 10;
    }
    while (carry) {
        num.push_back(carry % 10);
        carry /= 10;
    }
}

void add(vector<int>& sum, const vector<int>& num) {
    int carry = 0;
    for (int i = 0; i < num.size() || carry; i++) {
        if (i == sum.size()) sum.push_back(0);
        sum[i] += carry + (i < num.size() ? num[i] : 0);
        carry = sum[i] / 10;
        sum[i] %= 10;
    }
}

int main() {
    int n;
    cin >> n;
    vector<int> sum, num = {1};
    for (int i = 1; i <= n; i++) {
        multiply(num, i);
        add(sum, num);
    }
    for (int i = sum.size() - 1; i >= 0; i--) cout << sum[i];
    return 0;
}